<?php require_once("../controler/classes.php");

$name 		= $_POST['name'];
$username 	= $_POST['user'];
$password 	= $_POST['pass'];
$email 		= $_POST['mail'];

$password = md5($password);

$name	 	= mysql_real_escape_string($name);
$username	= mysql_real_escape_string($username);
$email	 	= mysql_real_escape_string($email);
$name		= stripslashes($name);
$username 	= stripslashes($username);
$email	 	= stripslashes($email);



$user = new User();
if(!$user->verificar_email($email)){
	echo('E-mail em Formato inválido, favor inserir um e-mail correto.');
}else{
	if(!$user->registrar($name,$username,$password,$email)){
		echo('algo deu errado com o seu registro... não faço idéia do que seja.');
	}else{
		header("location: ../");
	}
}
//if(register($name, $user, $pass, $mail, $db) == TRUE){
//	header("location:../home/p/home");
//	}else echo "N&atilde;o Registrou";
?>